package otherPractice;


public class BankThread {

	
	public static void main(String[] args) {
		Bank bank = new Bank();
		
		new Thread(new Runnable() {
			@Override
			public  void run() {
				while(true) {
					try {
						Thread.sleep(1000);
						bank.addMoney(100);
						//bank.lookMoney();
						System.out.println("\n");
					} catch (InterruptedException e) {
						e.printStackTrace();
					}
				}
			}
		}).start();
		
		
		new Thread(new Runnable() {
			@Override
			public  void run() {
				while(true) {
					try {
						bank.subMoney(100);
						//bank.lookMoney();
						System.out.println("\n");
						Thread.sleep(1000);
					} catch (InterruptedException e) {
						e.printStackTrace();
					}
				}
			}
		}).start();
		
		
	}
	
	
}
